define([], function() {
    var app = angular.module("App.home");
    app.controller("projects.detail.summaryCtrl", ["$scope", "$timeout", "curPrj", function($scope, $timeout, curPrj) {
        $timeout(function() {
            var element = $('#PrjSummary');
            element[0].style.height = "" + (element[0].scrollHeight + 20) + "px";
        }, 400);
        $scope.uploadPrjSummary = function() {
            $scope.status = "uploading";
            curPrj.prjSummary = curPrj.prjSummary.replace(/\n/g, "\r\n");
            curPrj
                .postSummary()
                .then(function() {
                    $scope.status = "succeeded";
                }, function() {
                    $scope.status = "failed";
                });
        };
    }]);
});
